package com.demo.study.base.jvm;

import java.util.concurrent.TimeUnit;

/**
 * 堆内存测试
 *
 * @author baymax
 * @since 2025-07-10
 */
public class T06_Memory {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("1");
        TimeUnit.SECONDS.sleep(10);

        byte[] bytes = new byte[1024 * 1024 * 10];
        System.out.println("2");
        TimeUnit.SECONDS.sleep(5);

        bytes = null;
        System.gc();
        System.out.println("3");
        TimeUnit.SECONDS.sleep(10);
    }
}
